import apiClient from './index';

// 获取所有患者
export const getPatients = () => {
  return apiClient.get('/patients');
};

// 根据ID获取患者基本信息
export const getPatientById = (patientId: number) => {
  return apiClient.get(`/patients/${patientId}`);
};

// 根据患者ID获取患者病案信息
export const getPatientCaseById = (patientId: number) => {
  return apiClient.get(`/patients/${patientId}/case`);
};

// 新增患者
export const createPatient = (data: object) => {
  return apiClient.post('/patients', data);
};

export const updatePatient = (id: number, data: object) => {
  return apiClient.put(`/patients/${id}`, data);
};

export const deletePatient = (id: number) => {
  return apiClient.delete(`/patients/${id}`);
};

